function nav_color() {
    let nav = document.getElementsByClassName("top_nav")[0];
    let _slideshow = document.getElementsByClassName("slideshow")[0];
    let nav_color_on = "background: linear-gradient(to right,#f1c40f,#e67e22,#e74c3c);"
    let nav_color_off = "background: rgba(255, 255, 255, 0)";

    function add_color() {
      let mask = GetRect(_slideshow);
      if (mask.top > -5) {
        nav.setAttribute("style", nav_color_off)
      } else {
        nav.setAttribute("style", nav_color_on);
      }
    }
    window.addEventListener("scroll",add_color)
  }
  nav_color();